@namespace MudBlazor.Docs.Examples
@using MudBlazor

<MudStack Row Class="justify-space-between mud-width-full">
    <MudStack Style="width: 300px">
        @foreach (var variant in Enum.GetValues(typeof(Variant)).Cast<Variant>())
        {
            <MudSelect @bind-Value="_value"
                       Variant="variant"
                       Label="@variant.ToString()"
                       Margin="_margin"
                       Dense="_dense"
                       FitContent="_fitContent"
                       Disabled="_disabled"
                       ReadOnly="_readonly"
                       Placeholder="@(_placeholder ? "Placeholder" : null)"
                       HelperText="@(_helperText ? "Helper Text" : null)"
                       HelperTextOnFocus="_helperTextOnFocus"
                       Clearable="_clearable"
                       Modal="_modal">
                @foreach (var state in _states)
                {
                    <MudSelectItem Value="state">@state</MudSelectItem>
                }
            </MudSelect>
        }
    </MudStack>

    <MudStack>
        <MudSelect @bind-Value="_margin" Label="Margin">
            @foreach (var margin in Enum.GetValues(typeof(Margin)).Cast<Margin>())
            {
                <MudSelectItem Value="margin">@margin</MudSelectItem>
            }
        </MudSelect>

        <MudSwitch @bind-Value="_dense" Label="Dense" Color="Color.Primary" />
        <MudSwitch @bind-Value="_readonly" Label="ReadOnly" Color="Color.Primary" />
        <MudSwitch @bind-Value="_disabled" Label="Disabled" Color="Color.Primary" />
        <MudSwitch @bind-Value="_placeholder" Label="Placeholder" Color="Color.Primary" />
        <MudSwitch @bind-Value="_helperText" Label="HelperText" Color="Color.Primary" />
        <MudSwitch @bind-Value="_helperTextOnFocus" Label="HelperTextOnFocus" Color="Color.Primary" />
        <MudSwitch @bind-Value="_clearable" Label="Clearable" Color="Color.Primary" />
        <MudSwitch @bind-Value="_fitContent" Label="FitContent" Color="Color.Primary" />
        <MudSwitch @bind-Value="_modal" Label="Modal" Color="Color.Primary" />
    </MudStack>
</MudStack>

@code {
    private string _value;
    private Margin _margin;
    private bool _dense;
    private bool _disabled;
    private bool _readonly;
    private bool _placeholder;
    private bool _helperText;
    private bool _helperTextOnFocus;
    private bool _clearable;
    private bool _fitContent;
    private bool _modal = true;

    private readonly string[] _states =
    {
        "Alabama", "Alaska", "Arizona", "Arkansas", "California",
        "Colorado", "Connecticut", "Delaware", "Florida", "Georgia",
        "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas",
        "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts",
        "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana",
        "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico",
        "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma",
        "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota",
        "Tennessee", "Texas", "Utah", "Vermont", "Virginia",
        "Washington", "West Virginia", "Wisconsin", "Wyoming"
    };
}
